package com.example.demo.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Showtype {
    private int stId;
    private String stTypeName;
    private List<Show> gh;


    @Id
    @Column(name = "st_ID", nullable = false)
    public int getStId() {
        return stId;
    }

    public void setStId(int stId) {
        this.stId = stId;
    }

    @Basic
    @Column(name = "st_typeName", nullable = false, length = 20)
    public String getStTypeName() {
        return stTypeName;
    }

    public void setStTypeName(String stTypeName) {
        this.stTypeName = stTypeName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Showtype showtype = (Showtype) o;
        return stId == showtype.stId &&
                Objects.equals(stTypeName, showtype.stTypeName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stId, stTypeName);
    }

    @OneToMany(mappedBy = "ghlx")
    public List<Show> getGh() {
        return gh;
    }

    public void setGh(List<Show> gh) {
        this.gh = gh;
    }
}
